#创建目录
mkdir -p ~/clickhouse/data  ~/clickhouse/config

#复制配置
docker run -d --rm --name tmp_ch --ulimit nofile=262144:262144 yandex/clickhouse-server
docker cp tmp_ch:/etc/clickhouse-server/config.xml ~/clickhouse/config/
docker kill tmp_ch

#运行容器
docker kill ch
docker rm ch
docker run -d --name ch --network net --network-alias ch --ulimit nofile=262144:262144 \
-p 9004:9004 -p 8123:8123 \
-v ~/clickhouse/data:/var/lib/clickhouse \
-v ~/clickhouse/config/config.xml:/etc/clickhouse-server/config.xml \
yandex/clickhouse-server